package 模拟读写数据;

/**
 * @ClassName: BusinessB
 * @Auther: Drawin
 * @Date: 2021/10/18 17:17
 * @Description:
 */

public class BusinessB {
        private IReadSaveData iReadSaveData;
        public IReadSaveData getiReadSaveData(){
            return iReadSaveData;
        }
        public void setiReadSaveData(IReadSaveData iReadSaveData){
            this.iReadSaveData=iReadSaveData;
        }
        public BusinessB(IReadSaveData iReadSaveData){
            this.iReadSaveData=iReadSaveData;
        }
        //业务方法，保存数据，保存到哪里有实际的对象ireadsavedata决定
        public void savaData(String data){
            iReadSaveData.saveData(data);
        }
        //业务方法，读取数据，从哪里读取由实际的对象ireadsavedata决定
        public String readData(){
            return iReadSaveData.getData();
        }

}
